<?php

class Leiloeiros_M extends I_Model {

    protected $_table_name = 'leiloeiros';
    protected $_primary_key = 'ID';
    protected $_primary_filter = 'intval';
    protected $_order_by = 'ID';
    public $rules = array();
    protected $_timestamps = TRUE;

    public function __construct() {
        parent::__construct();
    }

    
    function info($id = null, $row = false){
         
         
         $this->db->select('c.CONTA,b.NOME_BANCO AS BANCO ,l.*')
                  ->from('leiloeiros as l')
                  ->join('contas_bancarias as c','c.ID=l.CONTA_ID')
                  ->join('bancos as b','b.BANCO_ID=c.BANCO_ID')
                  ;
         
         if(!is_null($id)):
            $this->db->where(array('l.ID'=>$id));
         endif;
         $m = $row ? 'row':'result';
          $q = $this->db->get();
         return $q->$m();
                  
                   
    }
}
